/**
 * (1) Null
 *
 * null
 */
function literalNull() {
  let nu: null = null;
}

function varibaleNull() {
  // with strictNullCheck off
  let nullableObjWithStrictNullCheckOff: Object = null; // compile is ok
  nullableObjWithStrictNullCheckOff.toString(); // compiler is ok

  // with strictNullChecks on
  let nullableObjWithStrictNullCheckOn: Object | null = null; // compile is ok
  nullableObjWithStrictNullCheckOn.toString(); // compile is error

  let unNullableObjWithStrictNullCheckOn: Object = null; // compiler is error
}





/**
 * (2) Undefined
 *
 * undefined
 */
function literalUndefined() {
  let un1: undefined = undefined; // undefined 为变量，不是关键字，可以被修改，所以不推荐使用
  let un2: undefined = void 0;
}

function varibaleUndefined() {
  // with strictNullCheck off
  let undefinedableObjWithStrictCheckOff: Object; // 或者 undefinedableObjWithStrictCheckOff = undefined; // compiler is ok
  undefinedableObjWithStrictCheckOff.toString(); // compiler is ok

  // with strictNullCheck on
  let undefinedableObjWithStrictCheckOn: Object | undefined; // 或者 undefinedableObjWithStrictCheckOn = undefined; // compiler is ok
  undefinedableObjWithStrictCheckOn.toString(); // compiler is error

  let unUndefinedableObjWithStrictCheckOn: Object; // compiler is error
}
